package com.jimikongjian.models;

import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Repository;

import java.sql.Timestamp;
import java.util.List;

/**
 * Created by fuxiuyang on 17/2/19.
 */
@Scope("prototype")
@Repository("article")
public class Article {

    /**
     * 倒序
     */
    public static final int DESC = 1;

    /**
     * 正序
     */
    public static final int ASC = -1;

    /**
     * 根据用户的喜爱程度将文章进行排序
     */
    public static final int ORDER_BY_DEFAULT = 0;

    /**
     * 根据用户的创建时间排序
     */
    public static final int ORDER_BY_TIME = 1;

    /**
     * 根据用户的收藏进行展示
     */
    public static final int ORDER_BY_LIKE = 2;

    /**
     * 自身id号
     */
    private int id;

    /**
     * 作者id号，对应是user表中的id号
     */
    private int author;

    /**
     * 作者的昵称
     */
    private String authorNick;

    /**
     * 作者的头像
     */
    private String authorAvatar;

    /**
     * 文章的标题
     */
    private String title;

    /**
     * 文章的内容
     */
    private String content;

    /**
     * 文章被点击查看的次数
     */
    private int clickCount;

    /**
     * 文章点赞总数
     */
    private int upvoteCount;

    /**
     * 文章是否被点赞
     */
    private boolean upvote;

    /**
     * 文章评论总数
     */
    private int commentCount;

    /**
     * 文章分享总数
     */
    private int likeCount;

    /**
     * 文章是否被收藏
     */
    private boolean like;

    /**
     * 文章所属的所有的空间
     */
    private List<Integer> roomList;

    /**
     * 文章受欢迎程度权重
     */
    private float value=0;

    /**
     * 文章里的第一个封面
     */
    private String cover1;

    /**
     * 文章里的第二个封面
     */
    private String cover2;

    /**
     * 文章里的第三个封面
     */
    private String cover3;

    /**
     * 文章创建的时间
     */
    private Timestamp createTime;

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public int getAuthor() {
        return author;
    }

    public void setAuthor(int author) {
        this.author = author;
    }

    public String getAuthorNick() {
        return authorNick;
    }

    public void setAuthorNick(String authorNick) {
        this.authorNick = authorNick;
    }

    public String getAuthorAvatar() {
        return authorAvatar;
    }

    public void setAuthorAvatar(String authorAvatar) {
        this.authorAvatar = authorAvatar;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content;
    }

    public int getClickCount() {
        return clickCount;
    }

    public void setClickCount(int clickCount) {
        this.clickCount = clickCount;
    }

    public int getUpvoteCount() {
        return upvoteCount;
    }

    public void setUpvoteCount(int upvoteCount) {
        this.upvoteCount = upvoteCount;
    }

    public boolean isUpvote() {
        return upvote;
    }

    public void setUpvote(boolean upvote) {
        this.upvote = upvote;
    }

    public int getCommentCount() {
        return commentCount;
    }

    public void setCommentCount(int commentCount) {
        this.commentCount = commentCount;
    }

    public int getLikeCount() {
        return likeCount;
    }

    public void setLikeCount(int likeCount) {
        this.likeCount = likeCount;
    }

    public boolean isLike() {
        return like;
    }

    public void setLike(boolean like) {
        this.like = like;
    }

    public List getRoomList() {
        return roomList;
    }

    public void setRoomList(List roomList) {
        this.roomList = roomList;
    }

    public float getValue() {
        return value;
    }

    public void setValue(float value) {
        this.value = value;
    }

    public String getCover1() {
        return cover1;
    }

    public void setCover1(String cover1) {
        this.cover1 = cover1;
    }

    public String getCover2() {
        return cover2;
    }

    public void setCover2(String cover2) {
        this.cover2 = cover2;
    }

    public String getCover3() {
        return cover3;
    }

    public void setCover3(String cover3) {
        this.cover3 = cover3;
    }

    public Timestamp getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Timestamp createTime) {
        this.createTime = createTime;
    }
}
